//
//  JCPhotoGlobalVar.m
//  AXLPhotoBower
//
//  Created by gome on 2018/5/4.
//  Copyright © 2018年 gome. All rights reserved.
//


#import "JCPhotoGlobalVar.h"

@implementation JCPhotoGlobalVar

static id _JCPhotoGlobalVar;

+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
    @synchronized(self)
    {
        if (_JCPhotoGlobalVar==nil)
        {
            _JCPhotoGlobalVar = [super allocWithZone:zone];
        }
    }
    return _JCPhotoGlobalVar;
}
+ (instancetype)shareGlobalVar
{
    if (_JCPhotoGlobalVar == nil) //防止频繁加锁
    {
        @synchronized(self)
        {
            if (_JCPhotoGlobalVar==nil)//防止创建多次
            {
                _JCPhotoGlobalVar = [[self alloc]init];
            }
        }
    }
    return _JCPhotoGlobalVar;
}
- (id)copyWithZone:(NSZone *)zone
{
    return _JCPhotoGlobalVar;
}

@end
